import { getToken } from '@utils/auth'
// 弹窗1
export function errorMsg(text, duration = 2000) {
	let div = document.createElement('div')
	let html = '<div id="alert" class="common_alert" style="width:100%;height:100%;position:fixed;z-index:3200;top:0;left:0;display: flex;flex-direction: row;align-items: center;justify-content: center;"><span class="common_errorTips" style="max-width: 4rem;font-size:0.3rem;text-align: center;line-height: 1rem;color:#fff;display:inline-block;border-radius:8px;padding: 0 10px;background: rgba(0, 0, 0, 0.7);">'+text+'</span></div>';
	div.innerHTML = html
	document.body.appendChild(div)
	let sid = setTimeout(function () {
		var box=document.getElementById("alert");
		box.remove()
		clearTimeout(sid)
	}, duration)
}